var app = getApp()
// var util = require('../../../utils/util.js')
import { Movie } from 'class/Movie.js'

Page({
    data: {
        movie: {}
    },

    onLoad: function (options) {
        var movieId = options.id
        var url = app.globalData.doubanBase + 'v2/movie/subject/' + movieId
        var movie = new Movie(url)

        movie.getMovieData((movie) => {
            this.setData({
                movie: movie
            })
        })
    },

    /*查看图片*/
    viewMoviePostImg: function (e) {
        var src = e.currentTarget.dataset.src;
        wx.previewImage({
            current: src, // 当前显示图片的http链接
            urls: [src] // 需要预览的图片http链接列表
        })
    }
})